scrolledwindow: Remove redundant use of MAX
authorDebarshi Ray <debarshir@gnome.org>
Mon, 16 May 2016 19:50:05 +0000 (21:50 +0200)
committerDebarshi Ray <debarshir@gnome.org>
Tue, 17 May 2016 15:04:26 +0000 (17:04 +0200)
This code tries to add the minimum content size, if one is set, to the
GtkScrolledWindow's size requisition. This is obvious from the check
for non-negative values of min-content-height and min-content-width.
Using MAX needlessly makes the code harder to read by implying that
there is more to it when there actually isn't.

Fall out from 0d9ebb501df60cf1803858efcd1c79542588abd8

https://bugzilla.gnome.org/show_bug.cgi?id=766569

gtk/gtkscrolledwindow.c

index 884e37747b7945bfe198ce7bd5a47c8019c2d995..b6100d63b60549f0efad5e02fb07bc180da79773 100644 (file)
@@ -1757,8 +1757,8 @@ gtk_scrolled_window_measure (GtkCssGadget   *gadget,
            {
              if (priv->min_content_width >= 0)
                {
-                 minimum_req.width = MAX (minimum_req.width, priv->min_content_width);
-                 natural_req.width = MAX (natural_req.width, priv->min_content_width);
+                 minimum_req.width += priv->min_content_width;
+                 natural_req.width += priv->min_content_width;
                  extra_width = -1;
                }
              else if (policy_may_be_visible (priv->vscrollbar_policy) && !priv->use_indicators)
@@ -1783,8 +1783,8 @@ gtk_scrolled_window_measure (GtkCssGadget   *gadget,
            {
              if (priv->min_content_height >= 0)
                {
-                 minimum_req.height = MAX (minimum_req.height, priv->min_content_height);
-                 natural_req.height = MAX (natural_req.height, priv->min_content_height);
+                 minimum_req.height += priv->min_content_height;
+                 natural_req.height += priv->min_content_height;
                  extra_height = -1;
                }
              else if (policy_may_be_visible (priv->hscrollbar_policy) && !priv->use_indicators)